package com.news.pojo;

import java.io.Serializable;
import java.util.List;

public class Page<E> implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 当前页码
     */
    private int currPageNo;
    /**
     *页面大小，每页显示记录数
     */
    private int pageSize;
    /**
     * 记录数,总条数
      */
    private int totalCount;
    /**
     *总页数
     */
    private int totalPageCount;
    /**
     *每页新闻集合
     */
    private List<E> data;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public int getCurrPageNo() {
        return currPageNo;
    }

    public void setCurrPageNo(int currPageNo) {
        this.currPageNo = currPageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
        this.totalPageCount = (int)(Math.ceil(1.0*totalCount/pageSize));
    }

    public int getTotalPageCount() {
        return totalPageCount;
    }

    public List<E> getData() {
        return data;
    }

    public void setData(List<E> data) {
        this.data = data;
    }
}
